<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="OpenLS.Drawing.UI.TextResources" 
    xmlns:drawing="http://schemas.Kherty.com/office/2007/drawing" xmlns:UI="clr-namespace:OpenLS.UI;assembly=OpenLS.UI">
    <DataTemplate DataType="{x:Type drawing:TextBody}">
        <RichTextBox DataContext="{Binding}" Loaded ="OnLoaded" Background="Transparent" BorderThickness="0" LostFocus="UIElement_OnLostFocus">
            <RichTextBox.ContextMenu>
                <ContextMenu UI:RibbonElement.ControlState="Small">
                    <MenuItem Command="{x:Static ApplicationCommands.Cut}"></MenuItem>
                    <MenuItem Command="{x:Static ApplicationCommands.Copy}"></MenuItem>
                    <MenuItem Command="{x:Static ApplicationCommands.Paste}"></MenuItem>
                    <MenuItem Command="{x:Static ApplicationCommands.Delete}"></MenuItem>
                </ContextMenu>

            </RichTextBox.ContextMenu>
        </RichTextBox>
    </DataTemplate>
    <DataTemplate DataType="{x:Type drawing:TextBody}" x:Key="smallTextBodyTemplate">
        <TextBlock Text="{Binding Paragraphs[0].Runs[0].Text}" Name="tb" TextAlignment="Center" >
            <TextBlock.LayoutTransform>
                <RotateTransform Angle="{Binding BodyProperties.Rotation}">
                </RotateTransform>
            </TextBlock.LayoutTransform>
        </TextBlock>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding ElementName=tb, Path=Text}" Value="{x:Null}">
                <Setter TargetName="tb" Property="Height" Value="0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ElementName=tb, Path=Text.Length}" Value="0">
                <Setter TargetName="tb" Property="Height" Value="0"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>